<!-- BEGIN PAGE HEADER-->
<?php $this->load->view('partials/breadcrumb.tpl',  Array('_NO_IOSS_NEW'=>'1'))?>
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<script type="text/javascript">
var Polling = {};
Polling.lastId = '<?=$lastItem->id?>';
Polling.ajaxReq = function(){
	$.post("<?=site_url($thisModule.$thisController.'/pollingOrderLastId/')?>",{},function(ret){
		var retObj = $.parseJSON(ret);
		if(Polling.lastId == retObj.lastId || retObj.lastId == null){	//请求的最新id与当前的相等，说明没有新记录产生
			console.log('没有新记录产生');
		}else{	//请求的最新id与当前的不同，说明有了新增的记录，将当前lastId更新后，作出提示
			Polling.lastId = retObj.lastId;
			//播放音乐 
			var audio = document.createElement("audio");
			audio.src = "<?=site_url('/static/audio/order_tips.mp3')?>";
			audio.play();
			$('#audio_tip').show();
		}
		
	});
}

$(document).ready(function(){
	/*
	$("#reset").click(function(){
		$("select").val('');
		$("input[type='text']").val('');
	});
	setInterval("Polling.ajaxReq()",15000);
	*/
	
	
});
function hide(obj){
	$(obj).hide();
}
</script>
<div class="row">
	<div class="col-md-12">
		<!-- Begin: life time stats -->
		<div class="portlet">
			<?=form_open('', Array('class'=>'form-inline', 'role'=>'form'))?>
				<?=search_form_input('id',filterValue('id'),'用户ID', 'class="form-control input-medium"');?>
				<?=search_form_input('account',filterValue('account'),'用户账号', 'class="form-control input-medium"');?>
				<?=search_form_input('name',filterValue('name'),'用户名称', 'class="form-control input-medium"');?>
				<button type="button" class="btn default" id="reset">重置条件</button>
				<button type="submit" class="btn green about_search">搜索 <i class="fa fa-search"></i></button>
			<?=form_close()?>
			<div class="portlet-body">
				<div class="row">
					<div class="col-md-12">
						<div class="table-scrollable">
							<table class="table table-hover table-bordered table-striped">
								<thead>
								<tr>
									<th width="5%">订单ID</th>				
									<th width="10%">用户账号</th>
									<th width="10%">用户名称</th>
									<th width="20%">asin数量</th>
									<th width="20%">email数量</th>
									<th width="15%">创建时间</th>
								</tr>
								</thead>
								<tbody>
								<?php  foreach ($list as $node){	?>
									<tr>
										<td><?=htmlspecialchars($node->id)?></td>
										<td><?=htmlspecialchars($node->account)?></td>
										<td><?=htmlspecialchars($node->name)?></td>
										<td><?=$node->asin_num?> <?php if($node->asin_num>0):?><a href="<?=site_url($thisModule.$thisController.'/averageasin/'.$node->id)?>" onclick="javascript:hide(this)" class="btn btn-sm green">平均分配给其他在职人员</a><?php endif;?></td>
										<td><?=$node->email_num?>  <?php if($node->email_num>0):?><a href="<?=site_url($thisModule.$thisController.'/averageemail/'.$node->id)?>" onclick="javascript:hide(this)" class="btn btn-sm green">平均分配给其他在职人员</a><?php endif;?></td>
										<td><?=date('Y-m-d H:i:s',$node->create_time)?></td>
									</tr>
								<?php }?>
								</tbody>
							</table>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-md-12 text-right">
						<?=$pagination?>
					</div>
				</div>
			</div>
		</div>
		<!-- End: life time stats -->
	</div>
</div>
<!-- END PAGE CONTENT-->
